import 'dart:async';
import 'package:flutter/material.dart';
import 'package:wanchong/path.dart';

class Choose extends StatefulWidget {
  @override
  _ReleaseState createState() => _ReleaseState();
}

class _ReleaseState extends State<Choose> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: new AppBar(
        elevation: 0.0,
        title: new Text(
          '脖圈 AIR PRO',
          style: new TextStyle(
            color: Color(0xFF3C4450),
            fontSize: 15.0,
            fontWeight: FontWeight.w700,
          ),
        ),
        centerTitle: true,
        // leading: Container(
        //     padding: EdgeInsets.only(right: 15.0),
        //     color: Colors.transparent,
        //     height: double.infinity,
        //     child: GestureDetector(
        //       onTap: () {
        //         Navigator.pop(context);
        //       },
        //       child: Image.asset("assets/login/top_return_icon.png"),
        //     )
        //     //child: Image.asset("assets/login/top_return_icon.png"),
        //     ),
        actions: <Widget>[
          new IconButton(
              icon: new Icon(Icons.add_circle_outline),
              tooltip: 'Add Alarm',
              onPressed: () {
                // print("点击了扫码");
                Navigator.of(context).pushNamed(QRSacnPath);
              }),
        ],
      ),
      body: Container(
        child: Column(
          children: <Widget>[
            Container(
              height: 120,
              child: Image.asset('assets/pet/equipment_ad_a_img.png'),
            ),
            Expanded(
              child: ListView(
                physics: BouncingScrollPhysics(),
                children: <Widget>[
                  GestureDetector(
                    onTap: (){
                      Navigator.of(context).pushNamed(CallPath);
                    },
                    child:  Container(
                    margin: EdgeInsets.only(left: 15.0, right: 15.0, top: 15.0),
                    padding: EdgeInsets.only(left: 10.0, right: 10.0),
                    height: 100,
                    decoration: BoxDecoration(
                        border: Border.all(color: Colors.white, width: 1.0),
                        color: Colors.white,
                        borderRadius: BorderRadius.circular(5.0)),
                    child: Column(
                      children: <Widget>[
                        Stack(
                          children: <Widget>[
                            new Align(
                              alignment: FractionalOffset.topLeft,
                              child: Container(
                                margin: EdgeInsets.only(top: 10.0),
                                child: Text(
                                  'BQ-AP-2452-770',
                                  style: new TextStyle(
                                      fontSize: 17.0, color: Color(0xFF3C4450)),
                                ),
                              ),
                            ),
                            new Positioned(
                              top: 11.0,
                              right: 0.0,
                              child: Container(
                                child: Row(
                                  children: <Widget>[
                                    Container(
                                      width: 9.0,
                                      height: 9.0,
                                      decoration: BoxDecoration(
                                          border: Border.all(
                                              color: Color(0xFFEEEEEE),
                                              width: 1.0),
                                          color: Color(0xFFEEEEEE),
                                          borderRadius:
                                              BorderRadius.circular(5.0)),
                                    ),
                                    Container(
                                      margin: EdgeInsets.only(left: 5.0),
                                      child: Text(
                                        '离线',
                                        style: new TextStyle(
                                            fontSize: 14.0,
                                            color: Color(0xFF647280)),
                                      ),
                                    )
                                  ],
                                ),
                              ),
                            )
                          ],
                        ),
                        Container(
                          margin: EdgeInsets.only(top: 10.0),
                          child: Row(
                            children: <Widget>[
                              Container(
                                margin: EdgeInsets.only(top: 2.0),
                                child: Image.asset(
                                    'assets/pet/equipment_battery_icon_f@2x.png',
                                    width: 24,
                                    height: 13,
                                    fit: BoxFit.cover),
                              ),
                              Container(
                                margin: EdgeInsets.only(left: 5.0),
                                child: Text(
                                  '电量未知',
                                  style: new TextStyle(
                                      fontSize: 14.0, color: Color(0xFFDBDBDB)),
                                ),
                              ),
                            ],
                          ),
                        ),
                        Container(
                          margin: EdgeInsets.only(top: 10.0),
                          child: Row(
                            children: <Widget>[
                              Text(
                                '已关联：',
                                style: new TextStyle(
                                    fontSize: 14.0, color: Color(0xFFB4BEC6)),
                              ),
                              Text(
                                '我是二哈',
                                style: new TextStyle(
                                    fontSize: 14.0, color: Color(0xFFB4BEC6)),
                              ),
                            ],
                          ),
                        )
                      ],
                    ),
                  ),
                  
                  ),
                 Container(
                    margin: EdgeInsets.only(left: 15, right: 15, top: 15),
                    padding: EdgeInsets.only(left: 10.0, right: 10.0),
                    height: 100,
                    decoration: BoxDecoration(
                        border: Border.all(color: Colors.white, width: 1.0),
                        color: Colors.white,
                        borderRadius: BorderRadius.circular(5.0)),
                    child: Column(
                      children: <Widget>[
                        Stack(
                          children: <Widget>[
                            new Align(
                              alignment: FractionalOffset.topLeft,
                              child: Container(
                                margin: EdgeInsets.only(top: 10.0),
                                child: Text(
                                  'BQ-AP-2452-770',
                                  style: new TextStyle(
                                      fontSize: 17.0, color: Color(0xFF3C4450)),
                                ),
                              ),
                            ),
                            new Positioned(
                              top: 11.0,
                              right: 0.0,
                              child: Container(
                                child: Row(
                                  children: <Widget>[
                                    Container(
                                      width: 9.0,
                                      height: 9.0,
                                      decoration: BoxDecoration(
                                          border: Border.all(
                                              color: Color(0xFF4DC975),
                                              width: 1.0),
                                          color: Color(0xFF4DC975),
                                          borderRadius:
                                              BorderRadius.circular(5.0)),
                                    ),
                                    Container(
                                      margin: EdgeInsets.only(left: 5.0),
                                      child: Text(
                                        '在线',
                                        style: new TextStyle(
                                            fontSize: 14.0,
                                            color: Color(0xFF4DC975)),
                                      ),
                                    )
                                  ],
                                ),
                              ),
                            )
                          ],
                        ),
                        Container(
                          margin: EdgeInsets.only(top: 10.0),
                          child: Row(
                            children: <Widget>[
                              Container(
                                margin: EdgeInsets.only(top: 2.0),
                                child: Image.asset(
                                    'assets/pet/equipment_battery_icon_g@2x.png',
                                    width: 24,
                                    height: 13,
                                    fit: BoxFit.cover),
                              ),
                              Container(
                                margin: EdgeInsets.only(left: 5.0),
                                child: Text(
                                  '充电中',
                                  style: new TextStyle(
                                      fontSize: 14.0, color: Color(0xFFFFCC33)),
                                ),
                              ),
                            ],
                          ),
                        ),
                        Container(
                          margin: EdgeInsets.only(top: 10.0),
                          child: Row(
                            children: <Widget>[
                              Text(
                                '已关联：',
                                style: new TextStyle(
                                    fontSize: 14.0, color: Color(0xFFB4BEC6)),
                              ),
                              Text(
                                '我是三哈',
                                style: new TextStyle(
                                    fontSize: 14.0, color: Color(0xFFB4BEC6)),
                              ),
                            ],
                          ),
                        )
                      ],
                    ),
                  ),
                ],
              ),
            ),
          ],
        ),
      ),
    );
  }
}

















// import 'package:flutter/material.dart';
// import 'package:wanchong/path.dart';

// class Choose extends StatefulWidget {
//   @override
//   _ChooseState createState() => _ChooseState();
// }

// class _ChooseState extends State<Choose> {
//   @override
//   Widget build(BuildContext context) {
//     return Scaffold(
//       body: Column(
//         children: <Widget>[
//           SizedBox(
//             height: 20.0,
//           ),
//           GestureDetector(
//             onTap: () {
//               Navigator.of(context).pushNamed(CallPath);
//             },
//             child: Container(
//               width: double.infinity,
//               padding: EdgeInsets.only(top: 12.0, bottom: 12.0),
//               color: Colors.yellow,
//               child: Center(
//                 child: Text("用户1"),
//               ),
//             ),
//           ),
//           SizedBox(
//             height: 20.0,
//           ),
//           GestureDetector(
//             onTap: () {},
//             child: Container(
//               width: double.infinity,
//               padding: EdgeInsets.only(top: 12.0, bottom: 12.0),
//               color: Colors.blue,
//               child: Center(
//                 child: Text("用户2"),
//               ),
//             ),
//           ),
//         ],
//       ),
//     );
//   }
// }
